package com.yjhb.android.sbz.mvp.comment

import com.yjhb.android.sbz.entity.Comment
import com.yjhb.android.sbz.http.HttpObserver
import com.yjhb.android.sbz.http.HttpTool
import com.yjhb.android.sbz.mvp.ConventionPresenter2


/**
 *  创建者 zx
 *  创建时间 2021/3/22 17:54
 */
class CommentPresenter(commentView: CommentView) : ConventionPresenter2<CommentView>(commentView){


    fun comment(comment:Comment){
        view?.onWait()
        model?.let {

            HttpTool.request(it.addComment(comment),object : HttpObserver<Any?>() {
                override fun onResult(data: Any?) {
                    view?.onSuccess()
                }

                override fun onError(code: Int, msg: String?) {
                    view?.onFailure(code, msg)
                }
            })
        }
    }

}